<?php
    header('content-type:text/html;charset=utf-8');
    $mysql_info = array(
        'host' => 'localhost:3306',
        'db_user' => 'root',
        'db_pwd' => 'root',
        'db' => 'mi'
    );
    $mysqli = new mysqli($mysql_info['host'],$mysql_info['db_user'],$mysql_info['db_pwd']);

    if($mysqli->connect_errno){
        die('连接错误'.$mysqli->connect_errno);
    }

    $mysqli->query('set names utf8');

    $select_db = $mysqli->select_db($mysql_info['db']);

    if(!$select_db){
        die('数据库选择错误'.$mysqli->error);
    }
